Skip to content

Beam attenuation#35

Open
Dan Henriksen (dihenriksen) wants to merge 38 commits into
mainfrom
beam-attenuation
Open

Beam attenuation#35
Dan Henriksen (dihenriksen) wants to merge 38 commits into
mainfrom
beam-attenuation

Conversation

@dihenriksen
Copy link
Copy Markdown
Contributor

@dihenriksen Dan Henriksen (dihenriksen) commented May 8, 2026

Mainly, this PR creates the ability to attenuate a beam by giving control over a set of attenuators:

  • Made AttenuatorBank, Attenuator, and other helper classes
  • Implemented movable protocol for those classes to control individual attenuators, and to set total attenuation
  • Tests for attenuation functionality

Also fixed various other issues:

  • Ignore test_eiger_async tests for now since they are very broken
  • Update ophyd-async version to match what is in cdi-profile-collection
  • Fix style problems
  • Remove python 3.10 from supported python versions due to compatibility issues with the latest version of ophyd-async

@dihenriksen Dan Henriksen (dihenriksen) marked this pull request as ready for review May 12, 2026 02:55
Copy link
Copy Markdown

@jwlodek Jakub Wlodek (jwlodek) left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Marked some suggestions. Mainly I'd recommend making both device classes Movables and re-work the current methods for changing states into a set method override.

Comment thread src/cditools/attenuator.py Outdated
Comment thread src/cditools/attenuator.py Outdated
Comment thread src/cditools/attenuator.py Outdated
Comment thread src/cditools/attenuator.py Outdated
Comment thread src/cditools/attenuator.py Outdated
Comment thread .github/workflows/cd.yml
Comment thread src/cditools/attenuator.py Outdated
Comment thread src/cditools/attenuator.py Outdated
Comment thread src/cditools/attenuator.py Outdated
Comment thread src/cditools/attenuator.py Outdated
Comment thread src/cditools/attenuator.py
Comment thread src/cditools/attenuator.py Outdated
Comment thread src/cditools/attenuator.py Outdated
"""
status = {}
active_attens = []
en = self.photon_energy
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are already in an async function here so

Suggested change
en = self.photon_energy
en = await self.energy.readback.value()

I may be wrong about the exact name, ophyd-async has a verb for "get me the one true number for this or explode".

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

energy is an ophyd object, so await does not work

Comment thread src/cditools/attenuator.py Outdated
Comment thread src/cditools/attenuator.py Outdated
…in material and thickness to constructor; added pixi format task; pass energy into utility methods; remove property reading energy
…st one in linear time; also it is easier to read
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants